<!--头部版块-->
<app-page-header [pageHeaderInfo]="pageHeaderInfo" />

<div class="normal-table-wrap">
  <nz-card class="m-b-10" [nzBodyStyle]="{ 'padding-bottom': 0 }">
    <app-water-mark />
    <form nz-form>
      <div nz-row [nzGutter]="{ xs: 8, sm: 16, md: 24 }">
        <div nz-col [nzLg]="8" [nzMd]="12" [nzSm]="24" [nzXl]="8" [nzXs]="24" [nzXXl]="8">
          <nz-form-item>
            <nz-form-label [nzFor]="">规则名称</nz-form-label>
            <nz-form-control>
              <input name="ruleName" nz-input placeholder="请输入" [(ngModel)]="searchParam.ruleName" />
            </nz-form-control>
          </nz-form-item>
        </div>
        <div nz-col [nzLg]="8" [nzMd]="12" [nzSm]="24" [nzXl]="8" [nzXs]="24" [nzXXl]="8">
          <nz-form-item>
            <nz-form-label [nzFor]="">描述</nz-form-label>
            <nz-form-control>
              <input name="desc" nz-input placeholder="请输入" [(ngModel)]="searchParam.desc" />
            </nz-form-control>
          </nz-form-item>
        </div>
        @if (!isCollapse) {
          <div nz-col [nzLg]="8" [nzMd]="12" [nzSm]="24" [nzXl]="8" [nzXs]="24" [nzXXl]="8">
            <nz-form-item>
              <nz-form-label [nzFor]="">服务调用次数</nz-form-label>
              <nz-form-control>
                <input name="desc" nz-input placeholder="请输入" [(ngModel)]="searchParam.desc" />
              </nz-form-control>
            </nz-form-item>
          </div>
          <div nz-col [nzLg]="8" [nzMd]="12" [nzSm]="24" [nzXl]="8" [nzXs]="24" [nzXXl]="8">
            <nz-form-item>
              <nz-form-label [nzFor]="">状态</nz-form-label>
              <nz-form-control>
                <input name="desc" nz-input placeholder="请输入" [(ngModel)]="searchParam.desc" />
              </nz-form-control>
            </nz-form-item>
          </div>
          <div nz-col [nzLg]="8" [nzMd]="12" [nzSm]="24" [nzXl]="8" [nzXs]="24" [nzXXl]="8">
            <nz-form-item>
              <nz-form-label [nzFor]="">上次调度时间</nz-form-label>
              <nz-form-control>
                <input name="desc" nz-input placeholder="请输入" [(ngModel)]="searchParam.desc" />
              </nz-form-control>
            </nz-form-item>
          </div>
        }

        <div class="m-b-8 text-right p-0" nz-col [nzLg]="8" [nzMd]="12" [nzSm]="24" [nzXl]="8" [nzXs]="24" [nzXXl]="8">
          <button nz-button [nzType]="'primary'">
            <i nz-icon nzType="search"></i>
            搜索
          </button>
          <button class="m-l-15" nz-button (click)="resetForm()">
            <i nz-icon nzTheme="outline" nzType="close-circle"></i>
            重置
          </button>
          <a class="collapse operate-text" (click)="toggleCollapse()">
            @if (isCollapse) {
              <span>展开</span>
            }
            @if (!isCollapse) {
              <span>收起</span>
            }
            <i nz-icon [nzType]="isCollapse ? 'down' : 'up'"></i>
          </a>
        </div>
      </div>
    </form>
  </nz-card>

  <app-card-table-wrap [btnTpl]="tableBtns" (reload)="reloadTable()">
    <app-tree-table
      [cashArray]="checkedCashArray"
      [tableConfig]="tableConfig"
      [tableData]="dataList"
      (changePageIndex)="getDataList($event)"
      (changePageSize)="changePageSize($event)"
      (selectedChange)="selectedChecked($event)"
      (sortFn)="changeSort($event)"
    ></app-tree-table>
    <ng-template #operationTpl let-children="children" let-id="id" let-parent="parent">
      <span class="operate-text" (click)="check(id, children, parent)">查看</span>
      <!--添加了权限的写法-->
      <!-- <span *appAuth="ActionCode.FireSysSettingDel" class="operate-text" (click)="del(id)">删除</span>-->
      <span class="operate-text" (click)="del(id)">删除</span>
      <span class="operate-text" (click)="edit(id)">编辑</span>
    </ng-template>
  </app-card-table-wrap>
</div>
<ng-template #highLightTpl let-sex="sex">
  <nz-badge nzStatus="processing" [nzText]="sex"></nz-badge>
</ng-template>
<ng-template #tableBtns>
  <button class="m-r-8" nz-button nzType="primary" (click)="add()">
    <i nz-icon nzType="plus"></i>
    新建
  </button>
  <button nz-button nzType="default" (click)="allDel()">
    <i nz-icon nzType="delete"></i>
    删除
  </button>
</ng-template>
